<%@ include file = "/js/_of_js.jsp"%>
<%@ include file = "/js/_js_for_select.jsp"%>
<%@ include file = "/js/_js_for_window.jsp"%>
<script>
    function goback()
    {
        window.location.href = "<%= request.getContextPath()%>/moduleinfor/sysframe/post/root.jsp?back=true";
    }

    function bodyLoadJS()
    {
        // 被聚焦的控件
        //detailForm.orgId.focus();
    }

    function addOrgs()
    {         
        openWinForAList("Org2OrgAList.jsp?ALType=Org2Org&rootOrgCode=null&rootRoleCode=null&selectedNodeType=ORG&isMultSelected=true","newwin1");
    }

    function delOrgs()
    {
        this.delSelectedOption(detailForm.orgIds);
    }

    function delAllOrgs()
    {
        this.delAllOptions(detailForm.orgIds);
    }

    function setValue(itemIds,itemNames,itemTypes)
    {
        for(var i = 0; i < itemIds.length; i ++)
        {
            if(itemTypes[i] == "ORG")
            {
                if(!this.checkOptionValue(detailForm.orgIds,itemIds[i]))
                {
                    this.addOption(detailForm.orgIds,itemIds[i],itemNames[i]);
                }
                continue;
            }
            if(itemTypes[i] == "ROLE")
            {
                if(!this.checkOptionValue(detailForm.roleIds,itemIds[i]))
                {
                    this.addOption(detailForm.roleIds,itemIds[i],itemNames[i]);
                }
                continue;
            }
            alert("地址本设置错误：" + itemTypes[i] + " 不该被选");
        }

    }

    function addRoles()
    { 
        openWinForAList("Role2RoleAList.jsp?ALType=Role2Role&rootOrgCode=null&rootRoleCode=null&selectedNodeType=ROLE&isMultSelected=true","newwin2");
    }
    
    function delRoles()
    {
        this.delSelectedOption(detailForm.roleIds);
    }

    function delAllRoles()
    {
        this.delAllOptions(detailForm.roleIds);
    }
</script>
<form name="detailForm" action="Controller.jsp" method="post">
    <tr>
        <td class="detailTD11">机构<font color="red"> *</font> </td>
        <td class="detailTD12">
            <table width="50%">
                <tr>
                	<td>
                        <select name="orgIds" size="8" multiple style="width=2.7in;"></select>
                    </td>
                	<td>
                        <table>
                            <tr>
                                <td><input type="button"  value="添加" onclick = "addOrgs()" ></td>
                            </tr>
                            <tr>
                                <td><input type="button"  value="删除" onclick = "delOrgs()" ></td>
                            </tr>
                            <tr>
                                <td><input type="button"  value="全删" onclick = "delAllOrgs()" ></td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
                &nbsp;&nbsp;<font color="red"><%= vr.getErrMess("orgIds")%></font>
        </td>
    </tr>
    <tr>
        <td class="detailTD21">角色<font color="red"> *</font> </td>
        <td class="detailTD22">
            <table width="50%">
                <tr>
                	<td>
                        <select name="roleIds" size="8" multiple style="width=2.7in;"></select>
                    </td>
                	<td>
                        <table>
                            <tr>
                             	<td><input type="button"  value="添加" onclick = "addRoles()" ></td>
                            </tr>
                            <tr>
                              	<td><input type="button"  value="删除" onclick = "delRoles()" ></td>
                            </tr>
                            <tr>
                               	<td><input type="button"  value="全删" onclick = "delAllRoles()" ></td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
                &nbsp;&nbsp;<font color="red"><%= vr.getErrMess("roleIds")%></font>
        </td>
    </tr>
    <tr>
        <td class="detailTD11">机构遍历高度<font color="red"> *</font> </td>
        <td class="detailTD12">
            <input type="text" name="orgLength" onkeyup="nextOfFocused(this)" afterFocusedJS="" of="true">
                &nbsp;&nbsp;<font color="red"><%= vr.getErrMess("orgLength")%></font>
        </td>
    </tr>
    <tr>
        <td class="detailTD21">角色遍历高度<font color="red"> *</font> </td>
        <td class="detailTD22">
                <input type="text" name="roleLength" onkeyup="nextOfFocused(this)" afterFocusedJS="" of="true">
                &nbsp;&nbsp;<font color="red"><%= vr.getErrMess("roleLength")%></font>
        </td>
    </tr>
        <input type="hidden" name="id">
        <input type="hidden" name="serviceURL">
        <input type="hidden" name="pri">
</form>
